//统一管理项目用户相关的接口

import request from '@/utils/request'

import type {
  ILoginFormData,
  ILoginResponseData,
  IUserInfoReponseData,
} from './type'

//项目用户相关的请求地址

enum API {
  LOGIN_URL = '/admin/acl/index/login',

  USER_INFO_URL = '/admin/acl/index/info',

  LOGOUT_URL = '/admin/acl/index/logout',
}
//登录接口
export const reqLogin = (data: ILoginFormData) => {
  return request.post<any, ILoginResponseData>(API.LOGIN_URL, data)
}

//获取用户信息
export const reqUserInfo = () => {
  return request.get<any, IUserInfoReponseData>(API.USER_INFO_URL)
}

//退出登录

export const reqLogout = () => {
  return request.post<any, any>(API.LOGOUT_URL)
}
